package com.gxa.learning.core.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 审批流程表的映射实体
 *
 * @author lijianmin
 * @date 2021/12/02  10:30:14
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "tb_examine_approval")
@ApiModel
public class ExamineApproval implements Serializable {

    /**
     * 审批流程编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "examine_approval_id")
    @ApiModelProperty(name = "id", value = "id", dataType = "Long", example = "1")
    private Long id;

    /**
     * 审批流程名称
     */
    @Column(name = "examine_approval_name", unique = true)
    @ApiModelProperty(name = "name", value = "name", dataType = "String", example = "培训计划1")
    private String name;

    /**
     * 审批流程类型 比如培训需求、添加角色.....
     */
    @Column(name = "examine_approval_type")
    @ApiModelProperty(name = "type", value = "type", dataType = "String", example = "培训计划")
    private String type;

    /**
     * 创建审批流程时间
     */
    @Column(name = "examine_approval_creation_time")
    @ApiModelProperty(name = "creationTime", value = "creationTime", dataType = "Date", example = "2021-12-03 19:19:50")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8")
    private Date creationTime;

    /**
     * 上传人编号(用户编号)  连接查询用户表(user)
     */
    @Column(name = "user_id")
    @ApiModelProperty(name = "userId", value = "userId", dataType = "Long", example = "1")
    private Long userId;

    /**
     * 审批状态      0 :审批中     1: 已通过         2: 已驳回
     */
    @Column(name = "examine_approval_state")
    @ApiModelProperty(name = "state", value = "state", dataType = "Integer", example = "1")
    private Integer state;

    /**
     * 审批说明
     */
    @Column(name = "examine_approval_explain")
    @ApiModelProperty(name = "explain", value = "explain", dataType = "String", example = "审批说明")
    private String explain;

    /**
     * 意见征询节点      需要几位审批人同意
     */
    @Column(name = "examine_approval_opinion")
    @ApiModelProperty(name = "opinion", value = "opinion", dataType = "Integer", example = "2")
    private Integer opinion;

    /**
     * 审批流程截止时间     意见征询节点的人数 * 流程节点截止时间
     */
    @Column(name = "examine_approva_expiration_date")
    @ApiModelProperty(name = "expirationDate", value = "expirationDate", dataType = "Date", example = "2021-12-09 19:21:03")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8")
    private Date expirationDate;


}
